<?php
/**
 * @package    Delcampe Community
 *
 * @copyright Sebastien Delcampe
 * @license Please, don't read or copy
 * @author afernando
 *
 * @version 1.0
**/
?>
<div id="page_title">Versioning History</div>
<div id="tooltip"></div> 
<?php
if(count($this->version_entries) == null)
{
?>
  <table width="100%" border="0" cellspacing="2" cellpadding="1">
    <tr>
      <td align="center" colspan="4">No translation key is found</td>     
    </tr>
  </table>
<?php
} else {    
?>
<table width="100%" border="0" cellspacing="2" cellpadding="1">
  <tr>
  	<td colspan="4">&nbsp;</td>
  </tr>
	<tr>
    <td width="8%" align="left" valign="top" class="txtblack1"><b>Version</b></td>
    <td width="30%" align="left" valign="top" class="txtblack1"><b>Translate Key</b></td>
    <td width="15%" align="left" valign="top" class="txtblack1"><b>Date</b></td>
    <td width="15%" align="left" valign="top" class="txtblack1"><b>Author</b></td>
  </tr>
  <tr>
    <td colspan="4">&nbsp;</td>
  </tr>  
<?php  
  foreach ($this->version_entries as $entry):  
    $id = (int)$entry['version_id'];
    $version_lang = $entry['version_lang'];
    $version = 'v' . $entry['version'];
    $key_text = $entry['contents'];
    $translation_key = $key_text . ' <a href="'.$this->url(
      array(
          'module' => 'translate',
    		  'controller' => 'index',
          'action'     => 'editversion',
          'id'		  => array('id' => $id ),
          'lang'	  => array('lang' => $version_lang ),
          'version' => array('version' => $entry['version'])
      ), 
      'default', 
      true).'" ">[edit]</a>';
    $date = $entry['date_modified'];
    $author = $entry['firstname'] . '&nbsp;' . $entry['surname'];
?>
  <tr>
    <td align="center"><?php echo $version; ?></td>
    <td align="left"><?php echo $translation_key; ?></td> 
    <td align="left"><?php echo $date; ?></td>
    <td align="left"><?php echo $author; ?></td>       
  </tr>
<?php
  endforeach;
}  
?>
</table>